function SendForm(method,url,data,beforeFunc,afterFunc,errFunc){
    $.ajax({
        url: url,
        type: method,
        data: data,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
            'Token': $.cookie("_login_token_"),
        },
        beforeSend: beforeFunc,
        success: afterFunc,
        error: errFunc,
    });
}

function ErrFunc(response) {
    const errInfo = JSON.parse(response.responseText);
    errCode = errInfo.code;
    errMsg = errInfo.msg;

    if (errCode === 401) {
        // 跳转到登录页
        if (window.frames.length !== parent.frames.length) {
            parent.window.open("/login",'_self');
        }else{
            window.open("/login",'_self');
        }
        return;
    }
    lightyear.notify(errMsg, 'danger', 1500, 'mdi mdi-alert-box', 'top', 'center');
}